package com.dux.springnative.springboot30;


import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;

/**
 * 自定义提示<br>
 *
 * @author VULCAN
 */
public class MyRuntimeHints implements RuntimeHintsRegistrar {

    @Override
    public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
        // Register method for reflection
        //Method method = ReflectionUtils.findMethod(EurekaJacksonCodec.class, "sayHello", String.class);
        //hints.reflection().registerMethod(method, ExecutableMode.INVOKE);

        /*Field mapper = ReflectionUtils.findField(EurekaJacksonCodec.class, "mapper");
        Field objectReaderByClass = ReflectionUtils.findField(EurekaJacksonCodec.class, "objectReaderByClass");
        Field objectWriterByClass = ReflectionUtils.findField(EurekaJacksonCodec.class, "objectWriterByClass");
        hints.reflection().registerField(mapper).registerField(objectReaderByClass).registerField(objectWriterByClass);*/

        // Register resources
        hints.resources().registerPattern("eureka/server.properties");

        // Register serialization
        //hints.serialization().registerType(MySerializableClass.class);

        // Register proxy
        //hints.proxies().registerJdkProxy(MyInterface.class);
    }
}
